﻿using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ShortLink.Common.Settings
{
    public class AppSettings
    {
        public static IConfiguration _configuration;

        public AppSettings(IConfiguration configuration)
        {
            _configuration = configuration;
        }

        public static string GetValue(params string[] args) 
        {
            if (args == null) 
            {
                throw new ArgumentNullException("args");
            }
            var key = string.Join(':', args);
            return _configuration[key] ?? string.Empty;
        }
    }
}
